<?php
include_once( ROOT . 'lib/core.function.php' );
include_once( ROOT . 'meta/city.meta.php' );
include_once( ROOT . 'lib/db.function.php' );
include_once( ROOT . 'lib/biz.function.php' );


	$city_select_key[11] = '北京';
	
	$city_select_key[12] = '天津';
	
	$city_select_key[13] = '河北';
	$city_option_key[13] = Array();
	$city_option_key[13][130100] = '石家庄';
	$city_option_key[13][130200] = '唐山';
	$city_option_key[13][130300] = '秦皇岛';
	$city_option_key[13][130400] = '邯郸';
	$city_option_key[13][130500] = '邢台';
	$city_option_key[13][130600] = '保定';
	$city_option_key[13][130700] = '张家口';
	$city_option_key[13][130800] = '承德';
	$city_option_key[13][130900] = '沧州';
	$city_option_key[13][131000] = '廊坊';
	$city_option_key[13][131100] = '衡水';

	$city_select_key[14] = '山西';
	$city_option_key[14] = Array();
	$city_option_key[14][140100] = '太原';
	$city_option_key[14][140200] = '大同';
	$city_option_key[14][140300] = '阳泉';
	$city_option_key[14][140400] = '长治';
	$city_option_key[14][140500] = '晋城';
	$city_option_key[14][140600] = '朔州';
	$city_option_key[14][140700] = '晋中';
	$city_option_key[14][140800] = '运城';
	$city_option_key[14][140900] = '忻州';
	$city_option_key[14][141000] = '临汾';
	$city_option_key[14][142300] = '吕梁地区';

	$city_select_key[15] = '内蒙古';
	$city_option_key[15] = Array();
	$city_option_key[15][150100] = '呼和浩特';
	$city_option_key[15][150200] = '包头';
	$city_option_key[15][150300] = '乌海';
	$city_option_key[15][150400] = '赤峰';
	$city_option_key[15][150500] = '通辽';
	$city_option_key[15][150600] = '鄂尔多斯';
	$city_option_key[15][150700] = '呼伦贝尔';
	$city_option_key[15][152200] = '兴安盟';
	$city_option_key[15][152500] = '锡林郭勒盟';
	$city_option_key[15][152600] = '乌兰察布盟';
	$city_option_key[15][152800] = '巴彦淖尔盟';
	$city_option_key[15][152900] = '阿拉善盟';

	$city_select_key[21] = '辽宁';
	$city_option_key[21] = Array();
	$city_option_key[21][210100] = '沈阳';
	$city_option_key[21][210200] = '大连';
	$city_option_key[21][210300] = '鞍山';
	$city_option_key[21][210400] = '抚顺';
	$city_option_key[21][210500] = '本溪';
	$city_option_key[21][210600] = '丹东';
	$city_option_key[21][210700] = '锦州';
	$city_option_key[21][210800] = '营口';
	$city_option_key[21][210900] = '阜新';
	$city_option_key[21][211000] = '辽阳';
	$city_option_key[21][211100] = '盘锦';
	$city_option_key[21][211200] = '铁岭';
	$city_option_key[21][211300] = '朝阳';
	$city_option_key[21][211400] = '葫芦岛';

	$city_select_key[22] = '吉林';
	$city_option_key[22] = Array();
	$city_option_key[22][220100] = '长春';
	$city_option_key[22][220200] = '吉林';
	$city_option_key[22][220300] = '四平';
	$city_option_key[22][220400] = '辽源';
	$city_option_key[22][220500] = '通化';
	$city_option_key[22][220600] = '白山';
	$city_option_key[22][220700] = '松原';
	$city_option_key[22][220800] = '白城';
	$city_option_key[22][222400] = '延边';

	$city_select_key[23] = '黑龙江';
	$city_option_key[23] = Array();
	$city_option_key[23][230100] = '哈尔滨';
	$city_option_key[23][230200] = '齐齐哈尔';
	$city_option_key[23][230300] = '鸡西';
	$city_option_key[23][230400] = '鹤岗';
	$city_option_key[23][230500] = '双鸭山';
	$city_option_key[23][230600] = '大庆';
	$city_option_key[23][230700] = '伊春';
	$city_option_key[23][230800] = '佳木斯';
	$city_option_key[23][230900] = '七台河';
	$city_option_key[23][231000] = '牡丹江';
	$city_option_key[23][231100] = '黑河';
	$city_option_key[23][231200] = '绥化';
	$city_option_key[23][232700] = '大兴安岭地区';

	$city_select_key[31] = '上海';
	
	$city_select_key[32] = '江苏';
	$city_option_key[32] = Array();
	$city_option_key[32][320100] = '南京';
	$city_option_key[32][320200] = '无锡';
	$city_option_key[32][320300] = '徐州';
	$city_option_key[32][320400] = '常州';
	$city_option_key[32][320500] = '苏州';
	$city_option_key[32][320600] = '南通';
	$city_option_key[32][320700] = '连云港';
	$city_option_key[32][320800] = '淮安';
	$city_option_key[32][320900] = '盐城';
	$city_option_key[32][321000] = '扬州';
	$city_option_key[32][321100] = '镇江';
	$city_option_key[32][321200] = '泰州';
	$city_option_key[32][321300] = '宿迁';

	$city_select_key[33] = '浙江';
	$city_option_key[33] = Array();
	$city_option_key[33][330100] = '杭州';
	$city_option_key[33][330200] = '宁波';
	$city_option_key[33][330300] = '温州';
	$city_option_key[33][330400] = '嘉兴';
	$city_option_key[33][330500] = '湖州';
	$city_option_key[33][330600] = '绍兴';
	$city_option_key[33][330700] = '金华';
	$city_option_key[33][330800] = '衢州';
	$city_option_key[33][330900] = '舟山';
	$city_option_key[33][331000] = '台州';
	$city_option_key[33][331100] = '丽水';

	$city_select_key[34] = '安徽';
	$city_option_key[34] = Array();
	$city_option_key[34][340100] = '合肥';
	$city_option_key[34][340200] = '芜湖';
	$city_option_key[34][340300] = '蚌埠';
	$city_option_key[34][340400] = '淮南';
	$city_option_key[34][340500] = '马鞍山';
	$city_option_key[34][340600] = '淮北';
	$city_option_key[34][340700] = '铜陵';
	$city_option_key[34][340800] = '安庆';
	$city_option_key[34][341000] = '黄山';
	$city_option_key[34][341100] = '滁州';
	$city_option_key[34][341200] = '阜阳';
	$city_option_key[34][341300] = '宿州';
	$city_option_key[34][341400] = '巢湖';
	$city_option_key[34][341500] = '六安';
	$city_option_key[34][341600] = '亳州';
	$city_option_key[34][341700] = '池州';
	$city_option_key[34][341800] = '宣城';

	$city_select_key[35] = '福建';
	$city_option_key[35] = Array();
	$city_option_key[35][350100] = '福州';
	$city_option_key[35][350200] = '厦门';
	$city_option_key[35][350300] = '莆田';
	$city_option_key[35][350400] = '三明';
	$city_option_key[35][350500] = '泉州';
	$city_option_key[35][350600] = '漳州';
	$city_option_key[35][350700] = '南平';
	$city_option_key[35][350800] = '龙岩';
	$city_option_key[35][350900] = '宁德';

	$city_select_key[36] = '江西';
	$city_option_key[36] = Array();
	$city_option_key[36][360100] = '南昌';
	$city_option_key[36][360200] = '景德镇';
	$city_option_key[36][360300] = '萍乡';
	$city_option_key[36][360400] = '九江';
	$city_option_key[36][360500] = '新余';
	$city_option_key[36][360600] = '鹰潭';
	$city_option_key[36][360700] = '赣州';
	$city_option_key[36][360800] = '吉安';
	$city_option_key[36][360900] = '宜春';
	$city_option_key[36][361000] = '抚州';
	$city_option_key[36][361100] = '上饶';

	$city_select_key[37] = '山东';
	$city_option_key[37] = Array();
	$city_option_key[37][370100] = '济南';
	$city_option_key[37][370200] = '青岛';
	$city_option_key[37][370300] = '淄博';
	$city_option_key[37][370400] = '枣庄';
	$city_option_key[37][370500] = '东营';
	$city_option_key[37][370600] = '烟台';
	$city_option_key[37][370700] = '潍坊';
	$city_option_key[37][370800] = '济宁';
	$city_option_key[37][370900] = '泰安';
	$city_option_key[37][371000] = '威海';
	$city_option_key[37][371100] = '日照';
	$city_option_key[37][371200] = '莱芜';
	$city_option_key[37][371300] = '临沂';
	$city_option_key[37][371400] = '德州';
	$city_option_key[37][371500] = '聊城';
	$city_option_key[37][371600] = '滨州';
	$city_option_key[37][371700] = '荷泽';

	$city_select_key[41] = '河南';
	$city_option_key[41] = Array();
	$city_option_key[41][410100] = '郑州';
	$city_option_key[41][410200] = '开封';
	$city_option_key[41][410300] = '洛阳';
	$city_option_key[41][410400] = '平顶山';
	$city_option_key[41][410500] = '安阳';
	$city_option_key[41][410600] = '鹤壁';
	$city_option_key[41][410700] = '新乡';
	$city_option_key[41][410800] = '焦作';
	$city_option_key[41][410900] = '濮阳';
	$city_option_key[41][411000] = '许昌';
	$city_option_key[41][411100] = '漯河';
	$city_option_key[41][411200] = '三门峡';
	$city_option_key[41][411300] = '南阳';
	$city_option_key[41][411400] = '商丘';
	$city_option_key[41][411500] = '信阳';
	$city_option_key[41][411600] = '周口';
	$city_option_key[41][411700] = '驻马店';

	$city_select_key[42] = '湖北';
	$city_option_key[42] = Array();
	$city_option_key[42][420100] = '武汉';
	$city_option_key[42][420200] = '黄石';
	$city_option_key[42][420300] = '十堰';
	$city_option_key[42][420500] = '宜昌';
	$city_option_key[42][420600] = '襄樊';
	$city_option_key[42][420700] = '鄂州';
	$city_option_key[42][420800] = '荆门';
	$city_option_key[42][420900] = '孝感';
	$city_option_key[42][421000] = '荆州';
	$city_option_key[42][421100] = '黄冈';
	$city_option_key[42][421200] = '咸宁';
	$city_option_key[42][421300] = '随州';
	$city_option_key[42][422800] = '恩施土家族自治州';

	$city_select_key[43] = '湖南';
	$city_option_key[43] = Array();
	$city_option_key[43][430100] = '长沙';
	$city_option_key[43][430200] = '株洲';
	$city_option_key[43][430300] = '湘潭';
	$city_option_key[43][430400] = '衡阳';
	$city_option_key[43][430500] = '邵阳';
	$city_option_key[43][430600] = '岳阳';
	$city_option_key[43][430700] = '常德';
	$city_option_key[43][430800] = '张家界';
	$city_option_key[43][430900] = '益阳';
	$city_option_key[43][431000] = '郴州';
	$city_option_key[43][431100] = '永州';
	$city_option_key[43][431200] = '怀化';
	$city_option_key[43][431300] = '娄底';
	$city_option_key[43][433100] = '湘西土家族自治州';

	$city_select_key[44] = '广东';
	$city_option_key[44] = Array();
	$city_option_key[44][440100] = '广州';
	$city_option_key[44][440200] = '韶关';
	$city_option_key[44][440300] = '深圳';
	$city_option_key[44][440400] = '珠海';
	$city_option_key[44][440500] = '汕头';
	$city_option_key[44][440600] = '佛山';
	$city_option_key[44][440700] = '江门';
	$city_option_key[44][440800] = '湛江';
	$city_option_key[44][440900] = '茂名';
	$city_option_key[44][441200] = '肇庆';
	$city_option_key[44][441300] = '惠州';
	$city_option_key[44][441400] = '梅州';
	$city_option_key[44][441500] = '汕尾';
	$city_option_key[44][441600] = '河源';
	$city_option_key[44][441700] = '阳江';
	$city_option_key[44][441800] = '清远';
	$city_option_key[44][441900] = '东莞';
	$city_option_key[44][442000] = '中山';
	$city_option_key[44][445100] = '潮州';
	$city_option_key[44][445200] = '揭阳';
	$city_option_key[44][445300] = '云浮';

	$city_select_key[45] = '广西';
	$city_option_key[45] = Array();
	$city_option_key[45][450100] = '南宁';
	$city_option_key[45][450200] = '柳州';
	$city_option_key[45][450300] = '桂林';
	$city_option_key[45][450400] = '梧州';
	$city_option_key[45][450500] = '北海';
	$city_option_key[45][450600] = '防城港';
	$city_option_key[45][450700] = '钦州';
	$city_option_key[45][450800] = '贵港';
	$city_option_key[45][450900] = '玉林';
	$city_option_key[45][451000] = '百色';
	$city_option_key[45][451100] = '贺州';
	$city_option_key[45][451200] = '河池';
	$city_option_key[45][452100] = '南宁地区';
	$city_option_key[45][452200] = '柳州地区';

	$city_select_key[46] = '海南';
	$city_option_key[46] = Array();
	$city_option_key[46][460100] = '海口';
	$city_option_key[46][460200] = '三亚';
	$city_option_key[46][469000] = '其他';

	$city_select_key[50] = '重庆';
	
	$city_select_key[51] = '四川';
	$city_option_key[51] = Array();
	$city_option_key[51][510100] = '成都';
	$city_option_key[51][510300] = '自贡';
	$city_option_key[51][510400] = '攀枝花';
	$city_option_key[51][510500] = '泸州';
	$city_option_key[51][510600] = '德阳';
	$city_option_key[51][510700] = '绵阳';
	$city_option_key[51][510800] = '广元';
	$city_option_key[51][510900] = '遂宁';
	$city_option_key[51][511000] = '内江';
	$city_option_key[51][511100] = '乐山';
	$city_option_key[51][511300] = '南充';
	$city_option_key[51][511400] = '眉山';
	$city_option_key[51][511500] = '宜宾';
	$city_option_key[51][511600] = '广安';
	$city_option_key[51][511700] = '达州';
	$city_option_key[51][511800] = '雅安';
	$city_option_key[51][511900] = '巴中';
	$city_option_key[51][512000] = '资阳';
	$city_option_key[51][513200] = '阿坝自治州';
	$city_option_key[51][513300] = '甘孜自治州';
	$city_option_key[51][513400] = '凉山自治州';

	$city_select_key[52] = '贵州';
	$city_option_key[52] = Array();
	$city_option_key[52][520100] = '贵阳';
	$city_option_key[52][520200] = '六盘水';
	$city_option_key[52][520300] = '遵义';
	$city_option_key[52][520400] = '安顺';
	$city_option_key[52][522200] = '铜仁地区';
	$city_option_key[52][522300] = '黔西南布自治州';
	$city_option_key[52][522400] = '毕节地区';
	$city_option_key[52][522600] = '黔东南自治州';
	$city_option_key[52][522700] = '黔南布自治州';

	$city_select_key[53] = '云南';
	$city_option_key[53] = Array();
	$city_option_key[53][530100] = '昆明';
	$city_option_key[53][530300] = '曲靖';
	$city_option_key[53][530400] = '玉溪';
	$city_option_key[53][530500] = '保山';
	$city_option_key[53][530600] = '昭通';
	$city_option_key[53][532300] = '楚雄自治州';
	$city_option_key[53][532500] = '红河自治州';
	$city_option_key[53][532600] = '文山自治州';
	$city_option_key[53][532700] = '思茅地区';
	$city_option_key[53][532800] = '西双版纳自治州';
	$city_option_key[53][532900] = '大理自治州';
	$city_option_key[53][533100] = '德宏自治州';
	$city_option_key[53][533200] = '丽江地区';
	$city_option_key[53][533300] = '怒江自治州';
	$city_option_key[53][533400] = '迪庆自治州';
	$city_option_key[53][533500] = '临沧地区';

	$city_select_key[54] = '西藏';
	$city_option_key[54] = Array();
	$city_option_key[54][540100] = '拉萨';
	$city_option_key[54][542100] = '昌都地区';
	$city_option_key[54][542200] = '山南地区';
	$city_option_key[54][542300] = '日喀则地区';
	$city_option_key[54][542400] = '那曲地区';
	$city_option_key[54][542500] = '阿里地区';
	$city_option_key[54][542600] = '林芝地区';

	$city_select_key[61] = '陕西';
	$city_option_key[61] = Array();
	$city_option_key[61][610100] = '西安';
	$city_option_key[61][610200] = '铜川';
	$city_option_key[61][610300] = '宝鸡';
	$city_option_key[61][610400] = '咸阳';
	$city_option_key[61][610500] = '渭南';
	$city_option_key[61][610600] = '延安';
	$city_option_key[61][610700] = '汉中';
	$city_option_key[61][610800] = '榆林';
	$city_option_key[61][610900] = '安康';
	$city_option_key[61][611000] = '商洛';

	$city_select_key[62] = '甘肃';
	$city_option_key[62] = Array();
	$city_option_key[62][620100] = '兰州';
	$city_option_key[62][620200] = '嘉峪关';
	$city_option_key[62][620300] = '金昌';
	$city_option_key[62][620400] = '白银';
	$city_option_key[62][620500] = '天水';
	$city_option_key[62][620600] = '武威';
	$city_option_key[62][620700] = '张掖';
	$city_option_key[62][620800] = '平凉';
	$city_option_key[62][620900] = '酒泉';
	$city_option_key[62][621000] = '庆阳';
	$city_option_key[62][622400] = '定西地区';
	$city_option_key[62][622600] = '陇南地区';
	$city_option_key[62][622900] = '临夏自治州';
	$city_option_key[62][623000] = '甘南自治州';

	$city_select_key[63] = '青海';
	$city_option_key[63] = Array();
	$city_option_key[63][630100] = '西宁';
	$city_option_key[63][632100] = '海东地区';
	$city_option_key[63][632200] = '海北自治州';
	$city_option_key[63][632300] = '黄南自治州';
	$city_option_key[63][632500] = '海南自治州';
	$city_option_key[63][632600] = '果洛自治州';
	$city_option_key[63][632700] = '玉树自治州';
	$city_option_key[63][632800] = '海西蒙古族自治州';

	$city_select_key[64] = '宁夏';
	$city_option_key[64] = Array();
	$city_option_key[64][640100] = '银川';
	$city_option_key[64][640200] = '石嘴山';
	$city_option_key[64][640300] = '吴忠';
	$city_option_key[64][640400] = '固原';

	$city_select_key[65] = '新疆';
	$city_option_key[65] = Array();
	$city_option_key[65][650100] = '乌鲁木齐';
	$city_option_key[65][650200] = '克拉玛依';
	$city_option_key[65][652100] = '吐鲁番地区';
	$city_option_key[65][652200] = '哈密地区';
	$city_option_key[65][652300] = '昌吉回族自治州';
	$city_option_key[65][652700] = '博尔塔拉自治州';
	$city_option_key[65][652800] = '巴音郭楞自治州';
	$city_option_key[65][652900] = '阿克苏地区';
	$city_option_key[65][653000] = '克孜勒苏柯尔克孜自治州';
	$city_option_key[65][653100] = '喀什地区';
	$city_option_key[65][653200] = '和田地区';
	$city_option_key[65][654000] = '伊犁自治州';
	$city_option_key[65][654200] = '塔城地区';
	$city_option_key[65][654300] = '阿勒泰地区';

	$city_select_key[71] = '台湾';
	$city_option_key[71] = Array();
	$city_option_key[71][710100] = '台北市';
	$city_option_key[71][710200] = '台北县';
	$city_option_key[71][710300] = '基隆市';
	$city_option_key[71][710400] = '宜兰县';
	$city_option_key[71][710500] = '桃园县';
	$city_option_key[71][710600] = '新竹市';
	$city_option_key[71][710700] = '新竹县';
	$city_option_key[71][710800] = '苗栗县';
	$city_option_key[71][710900] = '台中市';
	$city_option_key[71][711000] = '台中县';
	$city_option_key[71][711100] = '南投县';
	$city_option_key[71][711200] = '彰化县';
	$city_option_key[71][711300] = '云林县';
	$city_option_key[71][711400] = '嘉义市';
	$city_option_key[71][711500] = '嘉义县';
	$city_option_key[71][711600] = '台南市';
	$city_option_key[71][711700] = '台南县';
	$city_option_key[71][711800] = '高雄市';
	$city_option_key[71][711900] = '高雄县';
	$city_option_key[71][712000] = '屏东县';
	$city_option_key[71][712100] = '花莲县';
	$city_option_key[71][712200] = '台东县';
	$city_option_key[71][712300] = '澎湖县';
	$city_option_key[71][712400] = '金门县';
	$city_option_key[71][712500] = '连江县';

	$city_select_key[81] = '香港';
	
	$city_select_key[82] = '澳门';
	
	$city_select_key[99] = '其它';

	foreach( $city_select_key as $key=>$value )
	{
		if( is_array( $city_option_key[$key] ) )
		{
			foreach( $city_option_key[$key] as $k=>$v )
			{
				$sql = " INSERT INTO `dy_city` ( `dy_city` , `dy_type` , `dy_name` ) VALUES ( '" . $k . "' , 'city' , '" . get_city_name_by_code( $k )  . "' ) ";
				mysql_query( $sql , $connect );
				//echo mysql_error();
				//echo $k .'#';
				//flush();
		
			}
			$type = 'province';
		}
		else
		{
			$type = 'icity';
		}

		$sql = " INSERT INTO `dy_city` ( `dy_city` , `dy_type` , `dy_name` ) VALUES ( '" . $key . "' , '$type' , '" . get_city_name_by_code( $key ) . "' ) ";
		mysql_query( $sql , $connect );
		//echo mysql_error();
		//echo $key .'$$';
		//flush();
		
	}

	//echo 'end';

?>